# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=mkosi
pkgver=24.3
pkgrel=0
pkgdesc="Build Bespoke OS Images"
url="https://mkosi.systemd.io/"
arch="noarch"
license="LGPL-2.1-or-later"
depends="
	bubblewrap
	coreutils
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/systemd/mkosi/archive/v$pkgver.tar.gz"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b74f3614574926338b610d8301b583f81765207ffd2b3bb0598557a72108a8d1fbd8922be5de51c12a5864d040ecf8af9750b4220718cc300d7ab83d034906e6  mkosi-24.3.tar.gz
"
